import { ComponentClass } from 'react'
import Taro, { Component, Config } from '@tarojs/taro'
import { AtTabBar, AtIcon, AtSearchBar } from 'taro-ui'
import classnames from 'classnames'
import { View, Image, Text,Button } from '@tarojs/components'
import { connect } from '@tarojs/redux'

import './NavTabBar.scss'
type IState = {
    current: number,
}
type IProps = {

}
export default class NavTabBar extends Component<IProps,IState>{
    config: Config = {
        navigationBarTitleText: '底部导航'
      }
      constructor (props) {
        super(props)
        this.state={
            current:0
        }
      }
      switchTab (value) {
        if (value !== 1) return
        Taro.reLaunch({
          url: '/pages/my/index'
        })
      }
      render(){
          return (
            <View >
                   <AtTabBar
                        fixed
                        selectedColor='#d43c33'
                        tabList={[
                            { title: '首页',  iconType: 'bullet-list'},
                            // { title: '我的',  iconType: 'clock' }
                        ]}
                        onClick={this.switchTab.bind(this)}
                        current={this.state.current}
                        />
            </View>
          )
      }
}